{% extends 'BlogBundle::layout.html.twig' %}

{% block title %} Blog's {{ viewBlog.title }} {% endblock %}
{% block btcontent %}
<p style="color:Blue">
{{ viewBlog.content }}
    </p>
    <H4>Send a comment</H4>
    {% if app.session.hasFlash('statusAdd') %} 
    <h5 style="color: Red"> 
       {{ app.session.flash('statusAdd') }} 
        </h5> 
{% endif %} 

{% if task is defined %}
    <H4 style="color: Red">{{task}} </H4>
{% endif %}
    <form action="{{path('BlogBundle_postComment')}}" method="post" {{form_enctype(formComment)}}>
        <input type="hidden" name="blogId" value="{{viewBlog.id}}" />
        {{ form_errors(formComment) }}
        <div class="CommentContent">
{{form_label(formComment.content)}}: {{ form_widget(formComment.content) }}
        </div>
        {{ form_rest(formComment) }}
            <input type="submit" value="Comment" />
        </form>
        <H4>View comments </H4>
{% for item in blogComments %}
        <fieldset>
            <legend>{{item.createdAt|date('d/m/Y - H:m:s')}}</legend>
            <p>{{item.content}}</p>
        </fieldset>
{% endfor%}

{% endblock %}

